home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Include / DShowIDL / dxtrans.idl < prev    next >
Encoding:
Text File  |  2002-11-12  |  44.9 KB  |  1,290 lines

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Copyright Microsoft Corporation 1997-2000
  4. //  All rights reserved.
  5. //
  6. //  File:   dxtrans.idl
  7. //
  8. //  Overview:
  9. //      This is the IDL file for DirectX installable transform coclass, 
  10. //      interface, and type definitions.
  11. //
  12. //------------------------------------------------------------------------------
  13.  
  14. cpp_quote("#include <servprov.h>")
  15. cpp_quote("#include <ddraw.h>")
  16. cpp_quote("#include <d3d.h>")
  17. cpp_quote("#include <d3drm.h>")
  18. cpp_quote("#include <urlmon.h>")
  19.  
  20. //--- Import base idl
  21. import "oaidl.idl";
  22. import "ocidl.idl";
  23. import "servprov.idl";
  24. import "comcat.idl";
  25.  
  26. //
  27. //  Since direct draw does not have an IDL, we'll define DDSURFACEDESC to
  28. //  be a void, but include ddraw.h in the header file.  This makes MIDL happy.
  29. //
  30. #ifndef DDSURFACEDESC
  31. cpp_quote("#if 0")
  32. cpp_quote("// Bogus definition used to make MIDL compiler happy")
  33. typedef void DDSURFACEDESC;
  34. typedef void D3DRMBOX;
  35. typedef void D3DVECTOR;
  36. typedef void D3DRMMATRIX4D;
  37. typedef void* LPSECURITY_ATTRIBUTES;
  38. cpp_quote("#endif")
  39. #endif
  40. //--- Additional includes
  41.  
  42. //--- Export
  43. cpp_quote( "#ifdef _DXTRANSIMPL")
  44. cpp_quote( "    #define _DXTRANS_IMPL_EXT _declspec(dllexport)")
  45. cpp_quote( "#else")
  46. cpp_quote( "    #define _DXTRANS_IMPL_EXT _declspec(dllimport)")
  47. cpp_quote( "#endif")
  48.  
  49. //=== Forward References ====================================================
  50. interface IDXTransformFactory;
  51. interface IDXTransform;
  52. interface IDXTaskManager;
  53. interface IDXSurfaceFactory;
  54. interface IDXSurface;
  55. interface IDXARGBSurfaceInit;
  56. interface IDXRawSurface;
  57. interface IDXARGBReadPtr;
  58. interface IDXARGBReadWritePtr;
  59. interface IDXDCLock;
  60. interface IDXTScale;
  61. interface IDXLookupTable;
  62. interface IDXTBindHost;
  63. interface IBindHost;
  64. interface IDXTScaleOutput;
  65. interface IDXGradient;
  66.  
  67. //=== Constants =============================================================
  68.  
  69. cpp_quote("//")
  70. cpp_quote("//   All GUIDs for DXTransform are declared in DXTGUID.C in the SDK include directory")
  71. cpp_quote("//")
  72. cpp_quote("EXTERN_C const GUID DDPF_RGB1;") 
  73. cpp_quote("EXTERN_C const GUID DDPF_RGB2;") 
  74. cpp_quote("EXTERN_C const GUID DDPF_RGB4;") 
  75. cpp_quote("EXTERN_C const GUID DDPF_RGB8;") 
  76. cpp_quote("EXTERN_C const GUID DDPF_RGB332;") 
  77. cpp_quote("EXTERN_C const GUID DDPF_ARGB4444;") 
  78. cpp_quote("EXTERN_C const GUID DDPF_RGB565;") 
  79. cpp_quote("EXTERN_C const GUID DDPF_BGR565;") 
  80. cpp_quote("EXTERN_C const GUID DDPF_RGB555;") 
  81. cpp_quote("EXTERN_C const GUID DDPF_ARGB1555;") 
  82. cpp_quote("EXTERN_C const GUID DDPF_RGB24;") 
  83. cpp_quote("EXTERN_C const GUID DDPF_BGR24;") 
  84. cpp_quote("EXTERN_C const GUID DDPF_RGB32;") 
  85. cpp_quote("EXTERN_C const GUID DDPF_BGR32;") 
  86. cpp_quote("EXTERN_C const GUID DDPF_ABGR32;") 
  87. cpp_quote("EXTERN_C const GUID DDPF_ARGB32;") 
  88. cpp_quote("EXTERN_C const GUID DDPF_PMARGB32;") 
  89. cpp_quote("EXTERN_C const GUID DDPF_A1;") 
  90. cpp_quote("EXTERN_C const GUID DDPF_A2;") 
  91. cpp_quote("EXTERN_C const GUID DDPF_A4;") 
  92. cpp_quote("EXTERN_C const GUID DDPF_A8;") 
  93. cpp_quote("EXTERN_C const GUID DDPF_Z8;") 
  94. cpp_quote("EXTERN_C const GUID DDPF_Z16;") 
  95. cpp_quote("EXTERN_C const GUID DDPF_Z24;") 
  96. cpp_quote("EXTERN_C const GUID DDPF_Z32;") 
  97. cpp_quote("//")
  98. cpp_quote("//   Component categories")
  99. cpp_quote("//")
  100. cpp_quote("EXTERN_C const GUID CATID_DXImageTransform;")
  101. cpp_quote("EXTERN_C const GUID CATID_DX3DTransform;")
  102. cpp_quote("EXTERN_C const GUID CATID_DXAuthoringTransform;")
  103. cpp_quote("EXTERN_C const GUID CATID_DXSurface;")
  104. cpp_quote("//")
  105. cpp_quote("//   Service IDs")
  106. cpp_quote("//")
  107. cpp_quote("EXTERN_C const GUID SID_SDirectDraw;")
  108. cpp_quote("EXTERN_C const GUID SID_SDirect3DRM;")
  109. cpp_quote("#define SID_SDXTaskManager CLSID_DXTaskManager")
  110. cpp_quote("#define SID_SDXSurfaceFactory IID_IDXSurfaceFactory")
  111. cpp_quote("#define SID_SDXTransformFactory IID_IDXTransformFactory")
  112. cpp_quote("//")
  113. cpp_quote("//   DXTransforms Core Type Library Version Info")
  114. cpp_quote("//")
  115. cpp_quote("#define DXTRANS_TLB_MAJOR_VER 1")
  116. cpp_quote("#define DXTRANS_TLB_MINOR_VER 1")
  117.  
  118. //=== Struct & Enum definitions =============================================
  119.  
  120. //=== Interface definitions =================================================
  121.  
  122.  
  123. //+-----------------------------------------------------------------------------
  124. //
  125. //  IDXBaseObject
  126. //
  127. //------------------------------------------------------------------------------
  128.  
  129.     [
  130.         object,
  131.         uuid(17B59B2B-9CC8-11d1-9053-00C04FD9189D),
  132.         helpstring("IDXBaseObject Interface"),
  133.         pointer_default(unique),
  134.         local
  135.     ]
  136.     interface IDXBaseObject : IUnknown
  137.     {
  138.         HRESULT GetGenerationId( [out]ULONG *pID);
  139.         HRESULT IncrementGenerationId([in] BOOL bRefresh);
  140.         HRESULT GetObjectSize( [out] ULONG *pcbSize);
  141.     };
  142.  
  143.  
  144. //+-----------------------------------------------------------------------------
  145. //
  146. //  Bounding rectangle and vector structures.
  147. //
  148. //------------------------------------------------------------------------------
  149.  
  150.     //--- Dimension identifiers
  151.     typedef enum DXBNDID
  152.     {
  153.         DXB_X = 0,
  154.         DXB_Y = 1,
  155.         DXB_Z = 2,
  156.         DXB_T = 3
  157.     } DXBNDID;
  158.  
  159.     //--- Bound types
  160.     typedef enum DXBNDTYPE
  161.     {
  162.         DXBT_DISCRETE,
  163.         DXBT_DISCRETE64,
  164.         DXBT_CONTINUOUS,
  165.         DXBT_CONTINUOUS64
  166.     } DXBNDTYPE;
  167.  
  168.     //--- Discrete bounds (image & sound)
  169.     typedef struct DXDBND
  170.     {
  171.         long  Min;    
  172.         long  Max;
  173.     } DXDBND;
  174.     typedef DXDBND DXDBNDS[4];
  175.  
  176.     typedef struct DXDBND64
  177.     {
  178.         LONGLONG Min;    
  179.         LONGLONG Max;
  180.     } DXDBND64;
  181.     typedef DXDBND64 DXDBNDS64[4];
  182.  
  183.     //--- Continuous bounds (geometry)
  184.     typedef struct DXCBND
  185.     {
  186.         float Min;    
  187.         float Max;
  188.     } DXCBND;
  189.     typedef DXCBND DXCBNDS[4];
  190.  
  191.     typedef struct DXCBND64
  192.     {
  193.         double Min;    
  194.         double Max;
  195.     } DXCBND64;
  196.     typedef DXCBND64 DXCBNDS64[4];
  197.  
  198.     //--- Combined space
  199.     typedef union DXBNDS switch( DXBNDTYPE eType ) u
  200.     {
  201.       case DXBT_DISCRETE:
  202.         DXDBND D[4];
  203.       case DXBT_DISCRETE64:
  204.         DXDBND64 LD[4];
  205.       case DXBT_CONTINUOUS:
  206.         DXCBND C[4];
  207.       case DXBT_CONTINUOUS64:
  208.         DXCBND64 LC[4];
  209.     } DXBNDS;
  210.  
  211.     //--- Discrete 4D vector
  212.     typedef long DXDVEC[4];
  213.     typedef LONGLONG DXDVEC64[4];
  214.  
  215.     //--- Continous 4D vector
  216.     typedef float DXCVEC[4];
  217.     typedef double DXCVEC64[4];
  218.  
  219.     //--- Combined space vector
  220.     typedef union DXVEC switch( DXBNDTYPE eType ) u
  221.     {
  222.       case DXBT_DISCRETE:
  223.         long D[4];
  224.       case DXBT_DISCRETE64:
  225.         LONGLONG LD[4];
  226.       case DXBT_CONTINUOUS:
  227.         float C[4];
  228.       case DXBT_CONTINUOUS64:
  229.         double LC[4];
  230.     } DXVEC;
  231.  
  232.  
  233. //+-----------------------------------------------------------------------------
  234. //
  235. //  IDXTransformFactory
  236. //
  237. //------------------------------------------------------------------------------
  238.  
  239.     [
  240.         object,
  241.         uuid(6A950B2B-A971-11d1-81C8-0000F87557DB),
  242.         helpstring("IDXTransformFactory Interface"),
  243.         pointer_default(unique),
  244.         local
  245.     ]
  246.     interface IDXTransformFactory : IServiceProvider
  247.     {
  248.         HRESULT SetService( [in]REFGUID guidService, 
  249.                             [in]IUnknown *pUnkService,
  250.                             [in]BOOL bWeakReference);
  251.  
  252.         HRESULT CreateTransform( [in, size_is(ulNumInputs)]IUnknown** punkInputs,
  253.                                  [in]ULONG ulNumInputs,
  254.                                  [in, size_is(ulNumOutputs)]IUnknown** punkOutputs,
  255.                                  [in]ULONG ulNumOutputs,
  256.                                  [in]IPropertyBag* pInitProps, [in]IErrorLog* pErrLog,
  257.                                  [in]REFCLSID TransCLSID, [in]REFIID TransIID,
  258.                                  [out, iid_is(TransIID)]void** ppTransform );
  259.  
  260.         HRESULT InitializeTransform( [in]IDXTransform* pTransform,
  261.                                      [in, size_is(ulNumInputs)]IUnknown** punkInputs,
  262.                                      [in]ULONG ulNumInputs,
  263.                                      [in, size_is(ulNumOutputs)]IUnknown** punkOutputs,
  264.                                      [in]ULONG ulNumOutputs,
  265.                                      [in]IPropertyBag* pInitProps, [in]IErrorLog* pErrLog );
  266.     };
  267.  
  268.  
  269. //+-----------------------------------------------------------------------------
  270. //
  271. //  IDXTransform
  272. //
  273. //------------------------------------------------------------------------------
  274.  
  275.     typedef enum DXTMISCFLAGS
  276.     {
  277.         DXTMF_BLEND_WITH_OUTPUT   = ( 1L << 0 ),
  278.         DXTMF_DITHER_OUTPUT       = ( 1L << 1 ),
  279.         DXTMF_OPTION_MASK         = (0x0000FFFF),   // Low word is settable options
  280.         DXTMF_VALID_OPTIONS       = (DXTMF_BLEND_WITH_OUTPUT | DXTMF_DITHER_OUTPUT),
  281.         //
  282.         //  Status flags can not be changed by call to SetMiscFlags
  283.         //
  284.         DXTMF_BLEND_SUPPORTED     = ( 1L << 16 ),
  285.         DXTMF_DITHER_SUPPORTED    = ( 1L << 17 ),
  286.         DXTMF_INPLACE_OPERATION   = ( 1L << 24 ),
  287.         DXTMF_BOUNDS_SUPPORTED    = ( 1L << 25 ),
  288.         DXTMF_PLACEMENT_SUPPORTED = ( 1L << 26 ),
  289.         DXTMF_QUALITY_SUPPORTED   = ( 1L << 27 ),
  290.         DXTMF_OPAQUE_RESULT       = ( 1L << 28 )
  291.     } DXTMISCFLAGS;
  292.  
  293.     typedef enum DXINOUTINFOFLAGS
  294.     {
  295.         DXINOUTF_OPTIONAL = ( 1L << 0)
  296.     } DXINOUTINFOFLAGS;
  297.  
  298.     [
  299.         object,
  300.         uuid(30A5FB78-E11F-11d1-9064-00C04FD9189D),
  301.         helpstring("IDXTransform Interface"),
  302.         pointer_default(unique),
  303.         local
  304.     ]
  305.     interface IDXTransform : IDXBaseObject
  306.     {
  307.         HRESULT Setup( [in, size_is(ulNumInputs)] IUnknown * const * punkInputs,
  308.                        [in]ULONG ulNumInputs,
  309.                        [in, size_is(ulNumOutputs)] IUnknown * const * punkOutputs,
  310.                        [in]ULONG ulNumOutputs,
  311.                        [in]DWORD dwFlags );
  312.         HRESULT Execute( [in]const GUID* pRequestID, [in]const DXBNDS *pClipBnds,
  313.                          [in]const DXVEC *pPlacement );
  314.         HRESULT MapBoundsIn2Out( [in] const DXBNDS *pInBounds,
  315.                                  [in]ULONG ulNumInBnds,
  316.                                  [in]ULONG ulOutIndex,
  317.                                  [out]DXBNDS *pOutBounds );
  318.         HRESULT MapBoundsOut2In( [in] ULONG ulOutIndex,
  319.                                  [in] const DXBNDS *pOutBounds,
  320.                                  [in] ULONG ulInIndex,
  321.                                  [out]DXBNDS *pInBounds );
  322.         HRESULT SetMiscFlags( [in] DWORD dwMiscFlags);
  323.         HRESULT GetMiscFlags( [out]DWORD * pdwMiscFlags );
  324.         HRESULT GetInOutInfo( [in]BOOL bIsOutput, [in]ULONG ulIndex,
  325.                               [out]DWORD *pdwFlags, [out, size_is(*pcIDs)] GUID *pIDs,
  326.                               [in, out] ULONG *pcIDs,
  327.                               [out] IUnknown **ppUnkCurrentObject);
  328.         HRESULT SetQuality( [in] float fQuality );
  329.         HRESULT GetQuality( [out] float * fQuality );
  330.     };
  331.  
  332.  
  333. //+-----------------------------------------------------------------------------
  334. //
  335. //  IDXSurfacePick
  336. //
  337. //------------------------------------------------------------------------------
  338.  
  339.     [
  340.         object,
  341.         uuid(30A5FB79-E11F-11d1-9064-00C04FD9189D),
  342.         helpstring("IDXSurfacePick Interface"),
  343.         pointer_default(unique),
  344.         local
  345.     ]
  346.     interface IDXSurfacePick : IUnknown
  347.     {
  348.         HRESULT PointPick([in]const DXVEC *pPoint,
  349.                           [out]ULONG * pulInputSurfaceIndex,
  350.                           [out]DXVEC *pInputPoint);
  351.     };
  352.  
  353.  
  354. //+-----------------------------------------------------------------------------
  355. //
  356. //  IDXTBindHost
  357. //
  358. //  Overview:
  359. //      This interface is used to set a site-specific bind host for a transform.
  360. //      Only transforms that need access to a bind host need to implement this 
  361. //      interface.
  362. //
  363. //      For some reason, MIDL does not like IBindHost, so we've declared this
  364. //      interface local.
  365. //
  366. //------------------------------------------------------------------------------
  367.  
  368.     [
  369.         object,
  370.         uuid(D26BCE55-E9DC-11d1-9066-00C04FD9189D),
  371.         helpstring("IDXTBindHost Interface"),
  372.         pointer_default(unique),
  373.         local
  374.     ]
  375.     interface IDXTBindHost : IUnknown
  376.     {
  377.         HRESULT SetBindHost([in] IBindHost * pBindHost);
  378.     };
  379.  
  380.  
  381. //+-----------------------------------------------------------------------------
  382. //
  383. //  IDXTaskManager
  384. //
  385. //  Overview:
  386. //      This interface is used to implement a task managment service provider to
  387. //      optimize thread usage.
  388. //
  389. //------------------------------------------------------------------------------
  390.  
  391.     typedef void (__stdcall DXTASKPROC)(void *pTaskData, BOOL* pbContinueProcessing );
  392.     typedef DXTASKPROC *PFNDXTASKPROC;
  393.  
  394.     typedef void (__stdcall DXAPCPROC)(DWORD dwData);
  395.     typedef DXAPCPROC *PFNDXAPCPROC;
  396.  
  397. cpp_quote("#ifdef __cplusplus")
  398.  
  399.     cpp_quote("typedef struct DXTMTASKINFO" )
  400.     cpp_quote("{")
  401.     cpp_quote("    PFNDXTASKPROC pfnTaskProc;       // Pointer to function to execute")
  402.     cpp_quote("    PVOID         pTaskData;         // Pointer to argument data")
  403.     cpp_quote("    PFNDXAPCPROC  pfnCompletionAPC;  // Pointer to completion APC proc")
  404.     cpp_quote("    DWORD         dwCompletionData;  // Pointer to APC proc data")
  405.     cpp_quote("    const GUID*   pRequestID;        // Used to identify groups of tasks")
  406.     cpp_quote("} DXTMTASKINFO;")
  407.  
  408. cpp_quote("#else")
  409.  
  410.         typedef struct DXTMTASKINFO
  411.         {
  412.             PVOID       pfnTaskProc;       // Pointer to function to execute
  413.             PVOID       pTaskData;         // Pointer to argument data
  414.             PVOID       pfnCompletionAPC;  // Pointer to completion APC proc
  415.             DWORD       dwCompletionData;  // Pointer to APC proc data
  416.             const GUID* pRequestID;        // Used to identify groups of tasks
  417.         } DXTMTASKINFO;
  418.  
  419. cpp_quote("#endif")
  420.  
  421.     [
  422.         object,
  423.         uuid(254DBBC1-F922-11d0-883A-3C8B00C10000),
  424.         helpstring("IDXTaskManager Interface"),
  425.         pointer_default(unique),
  426.         local
  427.     ]
  428.     interface IDXTaskManager : IUnknown
  429.     {
  430.         HRESULT QueryNumProcessors( [out]ULONG* pulNumProc );
  431.         HRESULT SetThreadPoolSize( [in]ULONG ulNumThreads );
  432.         HRESULT GetThreadPoolSize( [out]ULONG* pulNumThreads );
  433.         HRESULT SetConcurrencyLimit( [in]ULONG ulNumThreads );
  434.         HRESULT GetConcurrencyLimit( [out]ULONG* pulNumThreads );
  435.         HRESULT ScheduleTasks( [in]DXTMTASKINFO TaskInfo[],
  436.                                [in]HANDLE Events[],
  437.                                [out]DWORD TaskIDs[],
  438.                                [in]ULONG ulNumTasks, [in]ULONG ulWaitPeriod );
  439.         HRESULT TerminateTasks( [in]DWORD TaskIDs[], [in]ULONG ulCount,
  440.                                 [in]ULONG ulTimeOut );
  441.         HRESULT TerminateRequest( [in]REFIID RequestID, [in]ULONG ulTimeOut );
  442.     };
  443.  
  444.  
  445. //+-----------------------------------------------------------------------------
  446. //
  447. //  Sample structures (C++)
  448. //
  449. //  Overview:
  450. //      We want an operator so that we can cast from a DXSAMPLE to a DWORD, so 
  451. //      for C++ we will define the structure a special way.
  452. //
  453. //------------------------------------------------------------------------------
  454.  
  455. cpp_quote("#ifdef __cplusplus")
  456.  
  457.     cpp_quote("/////////////////////////////////////////////////////")
  458.     cpp_quote("")
  459.     cpp_quote("class DXBASESAMPLE;")
  460.     cpp_quote("class DXSAMPLE;")
  461.     cpp_quote("class DXPMSAMPLE;")
  462.     cpp_quote("")
  463.     cpp_quote("/////////////////////////////////////////////////////")
  464.     cpp_quote("")
  465.     cpp_quote("class DXBASESAMPLE")
  466.     cpp_quote("{")
  467.     cpp_quote("public:")
  468.     cpp_quote("    BYTE Blue;")
  469.     cpp_quote("    BYTE Green;")
  470.     cpp_quote("    BYTE Red;")
  471.     cpp_quote("    BYTE Alpha;")
  472.     cpp_quote("    DXBASESAMPLE() {}")
  473.     cpp_quote("    DXBASESAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :")
  474.     cpp_quote("        Alpha(alpha),")
  475.     cpp_quote("        Red(red),")
  476.     cpp_quote("        Green(green),")
  477.     cpp_quote("        Blue(blue) {}")
  478.     cpp_quote("    DXBASESAMPLE(const DWORD val) { *this = (*(DXBASESAMPLE *)&val); }")
  479.     cpp_quote("    operator DWORD () const {return *((DWORD *)this); }")
  480.     cpp_quote("    DWORD operator=(const DWORD val) { return *this = *((DXBASESAMPLE *)&val); }")
  481.     cpp_quote("}; // DXBASESAMPLE")
  482.     cpp_quote("")
  483.     cpp_quote("/////////////////////////////////////////////////////")
  484.     cpp_quote("")
  485.     cpp_quote("class DXSAMPLE : public DXBASESAMPLE")
  486.     cpp_quote("{")
  487.     cpp_quote("public:")
  488.     cpp_quote("    DXSAMPLE() {}")
  489.     cpp_quote("    DXSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :")
  490.     cpp_quote("         DXBASESAMPLE(alpha, red, green, blue) {}")
  491.     cpp_quote("    DXSAMPLE(const DWORD val) { *this = (*(DXSAMPLE *)&val); }")
  492.     cpp_quote("    operator DWORD () const {return *((DWORD *)this); }")
  493.     cpp_quote("    DWORD operator=(const DWORD val) { return *this = *((DXSAMPLE *)&val); }")
  494.     cpp_quote("    operator DXPMSAMPLE() const;")
  495.     cpp_quote("}; // DXSAMPLE")
  496.     cpp_quote("")
  497.     cpp_quote("/////////////////////////////////////////////////////")
  498.     cpp_quote("")
  499.     cpp_quote("class DXPMSAMPLE : public DXBASESAMPLE")
  500.     cpp_quote("{")
  501.     cpp_quote("public:")
  502.     cpp_quote("    DXPMSAMPLE() {}")
  503.     cpp_quote("    DXPMSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) :")
  504.     cpp_quote("         DXBASESAMPLE(alpha, red, green, blue) {}")
  505.     cpp_quote("    DXPMSAMPLE(const DWORD val) { *this = (*(DXPMSAMPLE *)&val); }")
  506.     cpp_quote("    operator DWORD () const {return *((DWORD *)this); }")
  507.     cpp_quote("    DWORD operator=(const DWORD val) { return *this = *((DXPMSAMPLE *)&val); }")
  508.     cpp_quote("    operator DXSAMPLE() const;")
  509.     cpp_quote("}; // DXPMSAMPLE")
  510.     cpp_quote("")
  511.     cpp_quote("//")
  512.     cpp_quote("// The following cast operators are to prevent a direct assignment of a DXSAMPLE to a DXPMSAMPLE")
  513.     cpp_quote("//")
  514.     cpp_quote("inline DXSAMPLE::operator DXPMSAMPLE() const { return *((DXPMSAMPLE *)this); }")
  515.     cpp_quote("inline DXPMSAMPLE::operator DXSAMPLE() const { return *((DXSAMPLE *)this); }")
  516.  
  517.  
  518. //+-----------------------------------------------------------------------------
  519. //
  520. //  Sample structures (IDL, C)
  521. //
  522. //------------------------------------------------------------------------------
  523.  
  524. cpp_quote("#else // !__cplusplus")
  525.  
  526.     typedef struct DXBASESAMPLE
  527.     {
  528.         BYTE Blue;
  529.         BYTE Green;
  530.         BYTE Red; 
  531.         BYTE Alpha;
  532.     } DXBASESAMPLE;
  533.  
  534.     typedef struct DXSAMPLE
  535.     {
  536.         BYTE Blue;
  537.         BYTE Green;
  538.         BYTE Red; 
  539.         BYTE Alpha;
  540.     } DXSAMPLE;
  541.  
  542.     typedef struct DXPMSAMPLE
  543.     {
  544.         BYTE Blue;
  545.         BYTE Green;
  546.         BYTE Red; 
  547.         BYTE Alpha;
  548.     } DXPMSAMPLE;
  549.  
  550. cpp_quote("#endif // !__cplusplus")
  551.  
  552. //+-----------------------------------------------------------------------------
  553. //
  554. //  DXRUNINFO structures.
  555. //
  556. //------------------------------------------------------------------------------
  557.  
  558.     typedef enum DXRUNTYPE
  559.     {
  560.         DXRUNTYPE_CLEAR  = 0,        // The run is zero Alpha
  561.         DXRUNTYPE_OPAQUE = 1,        // The run is full Alpha (i.e. 255)
  562.         DXRUNTYPE_TRANS  = 2,        // The run is non-zero Alpha
  563.         DXRUNTYPE_UNKNOWN= 3         // The run type is unknown.  Caller must inspect.
  564.     } DXRUNTYPE;
  565.  
  566.     const ULONG DX_MAX_RUN_INFO_COUNT = 128; // Defines the maximum number of RUNINFOs in a single row
  567.  
  568.  
  569.     cpp_quote("// Ignore the definition used by MIDL for TLB generation")
  570.     cpp_quote("#if 0")
  571.  
  572.     typedef struct DXRUNINFO
  573.     {
  574.         ULONG Bitfields;
  575.     } DXRUNINFO;
  576.  
  577.     cpp_quote("#endif // 0")
  578.  
  579.     // Emit the C definition to the H file directly, as bit fields are not
  580.     // supported by MIDL.
  581.  
  582.     cpp_quote("typedef struct DXRUNINFO")
  583.     cpp_quote("{")
  584.     cpp_quote("    ULONG   Type  : 2;   // Type")
  585.     cpp_quote("    ULONG   Count : 30;  // Number of samples in run")
  586.     cpp_quote("} DXRUNINFO;")
  587.  
  588.  
  589.     typedef enum DXSFCREATE
  590.     {
  591.         DXSF_FORMAT_IS_CLSID    = ( 1L << 0 ),
  592.         DXSF_NO_LAZY_DDRAW_LOCK = ( 1L << 1 )
  593.     } DXSFCREATE;
  594.  
  595.     typedef enum DXBLTOPTIONS
  596.     {
  597.         DXBOF_DO_OVER          = (1L << 0),
  598.         DXBOF_DITHER           = (1L << 1)
  599.     } DXBLTOPTIONS;
  600.  
  601.  
  602. //+-----------------------------------------------------------------------------
  603. //
  604. //  IDXSurfaceModifier
  605. //
  606. //------------------------------------------------------------------------------
  607.  
  608.     [
  609.         object,
  610.         uuid(144946F5-C4D4-11d1-81D1-0000F87557DB),
  611.         helpstring("IDXSurfaceFactory Interface"),
  612.         pointer_default(unique),
  613.         local
  614.     ]
  615.     interface IDXSurfaceFactory : IUnknown
  616.     {
  617.         HRESULT CreateSurface([in] IUnknown *pDirectDraw,
  618.                               [in] const DDSURFACEDESC * pDDSurfaceDesc,
  619.                               [in] const GUID * pFormatID,
  620.                               [in] const DXBNDS *pBounds, 
  621.                               [in] DWORD dwFlags,
  622.                               [in] IUnknown *punkOuter,
  623.                               [in] REFIID riid, 
  624.                               [out, iid_is( riid )] void ** ppDXSurface);
  625.  
  626.         HRESULT CreateFromDDSurface([in] IUnknown *pDDrawSurface,
  627.                               [in] const GUID *pFormatID,
  628.                               [in] DWORD dwFlags,
  629.                               [in] IUnknown *punkOuter,
  630.                               [in] REFIID riid, 
  631.                               [out, iid_is( riid )] void ** ppDXSurface);
  632.  
  633.         HRESULT LoadImage(
  634.                           [in] const LPWSTR pszFileName,
  635.                           [in] IUnknown *pDirectDraw,
  636.                           [in] const DDSURFACEDESC * pDDSurfaceDesc,
  637.                           [in] const GUID *pFormatID,
  638.                           [in] REFIID riid, 
  639.                           [out, iid_is( riid )] void ** ppDXSurface);
  640.  
  641.         HRESULT LoadImageFromStream([in] IStream *pStream,
  642.                                     [in] IUnknown *pDirectDraw,
  643.                                     [in] const DDSURFACEDESC * pDDSurfaceDesc,
  644.                                     [in] const GUID *pFormatID,
  645.                                     [in] REFIID riid, 
  646.                                     [out, iid_is( riid )] void ** ppDXSurface);
  647.  
  648.         HRESULT CopySurfaceToNewFormat( [in]IDXSurface* pSrc,
  649.                                                 [in] IUnknown *pDirectDraw,
  650.                                                 [in] const DDSURFACEDESC * pDDSurfaceDesc,
  651.                                                 [in] const GUID *pDestFormatID,
  652.                                                 [out] IDXSurface** ppNewSurface );
  653.  
  654.         HRESULT CreateD3DRMTexture([in] IDXSurface *pSrc,
  655.                                            [in] IUnknown *pDirectDraw,
  656.                                            [in] IUnknown *pD3DRM3,
  657.                                            [in] REFIID riid,
  658.                                            [out, iid_is(riid)] void **ppTexture3);
  659.  
  660.         HRESULT BitBlt([in] IDXSurface *pDest,
  661.                        [in] const DXVEC *pPlacement,
  662.                        [in] IDXSurface *pSrc,
  663.                        [in] const DXBNDS *pClipBounds,
  664.                        [in] DWORD dwFlags);
  665.     };
  666.  
  667.  
  668. //+-----------------------------------------------------------------------------
  669. //
  670. //  IDXSurfaceModifier
  671. //
  672. //------------------------------------------------------------------------------
  673.  
  674.     typedef enum DXSURFMODCOMPOP
  675.     {
  676.         DXSURFMOD_COMP_OVER         = 0,
  677.         DXSURFMOD_COMP_ALPHA_MASK   = 1,
  678.         DXSURFMOD_COMP_MAX_VALID    = 1
  679.     } DXSURFMODCOMPOP;
  680.     
  681.     [
  682.         object,
  683.         uuid(9EA3B637-C37D-11d1-905E-00C04FD9189D),
  684.         helpstring("IDXSurfaceModifier Interface"),
  685.         pointer_default(unique),
  686.         local
  687.     ]
  688.     interface IDXSurfaceModifier : IUnknown
  689.     {
  690.         HRESULT SetFillColor([in] DXSAMPLE Color);
  691.         HRESULT GetFillColor([out] DXSAMPLE *pColor);
  692.         HRESULT SetBounds([in] const DXBNDS *pBounds ); // Get supported though IDXSurface interface
  693.         HRESULT SetBackground([in] IDXSurface *pSurface);
  694.         HRESULT GetBackground([out] IDXSurface **ppSurface);
  695.         HRESULT SetCompositeOperation([in] DXSURFMODCOMPOP CompOp);
  696.         HRESULT GetCompositeOperation([out] DXSURFMODCOMPOP *pCompOp);
  697.         //
  698.         //  The following methods only apply to the FOREGROUND surface
  699.         //
  700.         HRESULT SetForeground([in] IDXSurface *pSurface, [in] BOOL bTile, [in] const POINT * pOrigin);
  701.         HRESULT GetForeground([out] IDXSurface **ppSurface, [out] BOOL *pbTile, [out] POINT * pOrigin);
  702.         HRESULT SetOpacity([in] float Opacity);
  703.         HRESULT GetOpacity([out] float *pOpacity);    
  704.         HRESULT SetLookup( [in]IDXLookupTable * pLookupTable );
  705.         HRESULT GetLookup( [out]IDXLookupTable ** ppLookupTable );
  706.     };
  707.  
  708.  
  709. //+-----------------------------------------------------------------------------
  710. //
  711. //  IDXSurface
  712. //
  713. //------------------------------------------------------------------------------
  714.  
  715.     typedef enum DXSAMPLEFORMATENUM
  716.     {
  717.         DXPF_FLAGSMASK      = (0xFFFF0000), // Top word is flags, low word is enum  
  718.         DXPF_NONPREMULT     = (0x00010000), // Flags to be OR'd with pixel formats
  719.         DXPF_TRANSPARENCY   = (0x00020000), // Color key or one-bit alpha (alpha only 0 or 0xFF)
  720.         DXPF_TRANSLUCENCY   = (0x00040000), // Alpha can be any value from 0->0xFF
  721.         //
  722.         //  This 3-bit field is used to determine what type of dithering to be used
  723.         //  
  724.         DXPF_2BITERROR      = (0x00200000), // 2 bits of error term 
  725.         DXPF_3BITERROR      = (0x00300000), // 3 bits of error term for color (16-bit color)
  726.         DXPF_4BITERROR      = (0x00400000), // 4 bits of error term (ARGB 4444)
  727.         DXPF_5BITERROR      = (0x00500000), // 5 bits of error term for color (8-bit color)
  728.         DXPF_ERRORMASK      = (0x00700000), // Mask of bits used for dithering
  729.  
  730.         DXPF_NONSTANDARD    = (0),  // To be used for any surface that is not one of the following formats
  731.                                     // This can be combined with DXPFNONPREMULT if the surface can work
  732.                                     // better in non-premultiplied space.
  733.         DXPF_PMARGB32       = (1 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY),
  734.         DXPF_ARGB32         = (2 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY),
  735.         DXPF_ARGB4444       = (3 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY | DXPF_4BITERROR),
  736.         DXPF_A8             = (4 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY),
  737.         DXPF_RGB32          = (5),
  738.         DXPF_RGB24          = (6),
  739.         DXPF_RGB565         = (7 | DXPF_3BITERROR),
  740.         DXPF_RGB555         = (8 | DXPF_3BITERROR),
  741.         DXPF_RGB8           = (9 | DXPF_5BITERROR),
  742.         DXPF_ARGB1555       = (10 | DXPF_TRANSPARENCY | DXPF_3BITERROR),
  743.         DXPF_RGB32_CK       = (DXPF_RGB32 | DXPF_TRANSPARENCY),
  744.         DXPF_RGB24_CK       = (DXPF_RGB24 | DXPF_TRANSPARENCY),
  745.         DXPF_RGB555_CK      = (DXPF_RGB555 | DXPF_TRANSPARENCY),
  746.         DXPF_RGB565_CK      = (DXPF_RGB565 | DXPF_TRANSPARENCY),
  747.         DXPF_RGB8_CK        = (DXPF_RGB8 | DXPF_TRANSPARENCY)
  748.     } DXSAMPLEFORMATENUM;
  749.  
  750.     typedef enum DXLOCKSURF
  751.     {
  752.         DXLOCKF_READ        =       0,
  753.         DXLOCKF_READWRITE   =       (1 << 0),
  754.         DXLOCKF_EXISTINGINFOONLY =  (1 << 1),   // If used in conjunction with WANTRUNINFO will prevent creation of a runmap if one does not exist
  755.         DXLOCKF_WANTRUNINFO =       (1 << 2),
  756.         //
  757.         // The flags in the high word should be specific to the type of pointer that
  758.         // is requested.  These flags define ARGB flags.  These flags are advisory and
  759.         // are not required to be set for ARGB locks.
  760.         //
  761.         DXLOCKF_NONPREMULT  =   (1 << 16),    // Caller will request non-premultiplied data
  762.         DXLOCKF_VALIDFLAGS  =   (DXLOCKF_READWRITE | DXLOCKF_EXISTINGINFOONLY | DXLOCKF_WANTRUNINFO | DXLOCKF_NONPREMULT)
  763.     } DXLOCKSURF;
  764.  
  765.     typedef enum DXSURFSTATUS
  766.     {
  767.         DXSURF_TRANSIENT    =   (1 << 0),   // Data in this surface changes often.    
  768.         DXSURF_READONLY     =   (1 << 1),   // Surface is read-only
  769.         DXSURF_VALIDFLAGS   =   (DXSURF_TRANSIENT | DXSURF_READONLY)    
  770.     } DXSURFSTATUS;
  771.  
  772.     [
  773.         object,
  774.         uuid(B39FD73F-E139-11d1-9065-00C04FD9189D),
  775.         helpstring("IDXSurface Interface"),
  776.         pointer_default(unique),
  777.         local
  778.     ]
  779.     interface IDXSurface : IDXBaseObject
  780.     {
  781.         HRESULT GetPixelFormat([out] GUID * pFormatID, [out] DXSAMPLEFORMATENUM *pSampleFormatEnum); 
  782.         HRESULT GetBounds( [out]DXBNDS *pBounds );
  783.         HRESULT GetStatusFlags([out] DWORD * pdwStatusFlags);
  784.         HRESULT SetStatusFlags([in] DWORD dwStatusFlags);
  785.         HRESULT LockSurface( [in]const DXBNDS *pBounds, [in]ULONG ulTimeOut, [in]DWORD dwFlags, 
  786.                              [in]REFIID riid, [out, iid_is(riid)] void **ppPointer,
  787.                              [out]ULONG* pulGenerationId );
  788.         HRESULT GetDirectDrawSurface( [in] REFIID riid,
  789.                                       [out, iid_is(riid)] void ** ppSurface);
  790.         HRESULT GetColorKey(DXSAMPLE * pColorKey);  // Can return E_NOTIMPL
  791.         HRESULT SetColorKey(DXSAMPLE ColorKey);     // Set color of 0 to get rid of color key, can return E_NOTIMPL
  792.         HRESULT LockSurfaceDC( [in] const DXBNDS *pBounds, [in]ULONG ulTimeOut, [in] DWORD dwFlags,
  793.                                [out] IDXDCLock **ppDCLock);
  794.         HRESULT SetAppData(DWORD_PTR dwAppData);
  795.         HRESULT GetAppData(DWORD_PTR *pdwAppData);
  796.     };
  797.  
  798.  
  799. //+-----------------------------------------------------------------------------
  800. //
  801. //  IDXSurfaceInit
  802. //
  803. //------------------------------------------------------------------------------
  804.  
  805.     [
  806.         object,
  807.         uuid(9EA3B639-C37D-11d1-905E-00C04FD9189D),
  808.         helpstring("IDXSurfaceInit Interface"),
  809.         pointer_default(unique),
  810.         local
  811.     ]
  812.     interface IDXSurfaceInit : IUnknown
  813.     {
  814.         HRESULT InitSurface([in] IUnknown *pDirectDraw,
  815.                             [in] const DDSURFACEDESC *pDDSurfaceDesc,
  816.                             [in] const GUID * pFormatID,
  817.                             [in] const DXBNDS *pBounds,
  818.                             [in] DWORD dwFlags);
  819.     };
  820.  
  821.  
  822. //+-----------------------------------------------------------------------------
  823. //
  824. //  IDXARGBSurfaceInit
  825. //
  826. //------------------------------------------------------------------------------
  827.  
  828.     [
  829.         object,
  830.         uuid(9EA3B63A-C37D-11d1-905E-00C04FD9189D),
  831.         helpstring("IDXARGBSurfaceInit Interface"),
  832.         pointer_default(unique),
  833.         local
  834.     ]
  835.     interface IDXARGBSurfaceInit : IDXSurfaceInit
  836.     {
  837.         HRESULT InitFromDDSurface( [in] IUnknown *pDDrawSurface,
  838.                                    [in] const GUID * pFormatID,
  839.                                    [in] DWORD dwFlags);
  840.         HRESULT InitFromRawSurface([in] IDXRawSurface *pRawSurface);
  841.     };
  842.  
  843.  
  844. //+-----------------------------------------------------------------------------
  845. //
  846. //  IDXARGBReadPtr
  847. //
  848. //------------------------------------------------------------------------------
  849.  
  850.     typedef struct tagDXNATIVETYPEINFO
  851.     {
  852.         BYTE *          pCurrentData;
  853.         BYTE *          pFirstByte;
  854.         long            lPitch;
  855.         DWORD           dwColorKey;
  856.     } DXNATIVETYPEINFO;
  857.  
  858.     typedef struct tagDXPACKEDRECTDESC
  859.     {
  860.         DXBASESAMPLE    *pSamples;
  861.         BOOL            bPremult;
  862.         RECT            rect;
  863.         long            lRowPadding;
  864.     } DXPACKEDRECTDESC;
  865.  
  866.     typedef struct tagDXOVERSAMPLEDESC
  867.     {
  868.         POINT       p;
  869.         DXPMSAMPLE  Color;
  870.     } DXOVERSAMPLEDESC;
  871.         
  872.     [
  873.         object,
  874.         uuid(EAAAC2D6-C290-11d1-905D-00C04FD9189D),
  875.         helpstring("IDXARGBReadPtr Interface"),
  876.         pointer_default(unique),
  877.         local
  878.     ]
  879.     interface IDXARGBReadPtr : IUnknown
  880.     {
  881.         HRESULT GetSurface( [in]REFIID riid, [out, iid_is( riid )]void ** ppSurface);
  882.         DXSAMPLEFORMATENUM GetNativeType( [out]DXNATIVETYPEINFO *pInfo );
  883.         void Move( [in]long cSamples );
  884.         void MoveToRow( [in]ULONG y );
  885.         void MoveToXY( [in]ULONG x, [in]ULONG y);
  886.         ULONG MoveAndGetRunInfo( [in]ULONG Row, [out] const DXRUNINFO** ppInfo );  // Returns count of runs
  887.         DXSAMPLE   * Unpack( [in]DXSAMPLE* pSamples, [in]ULONG cSamples, [in]BOOL bMove );
  888.         DXPMSAMPLE * UnpackPremult( [in]DXPMSAMPLE* pSamples, [in]ULONG cSamples, [in]BOOL bMove );
  889.         void UnpackRect([in] const DXPACKEDRECTDESC * pRectDesc);
  890.     };
  891.  
  892.  
  893. //+-----------------------------------------------------------------------------
  894. //
  895. //  IDXARGBReadWritePtr
  896. //
  897. //------------------------------------------------------------------------------
  898.  
  899.     [
  900.         object,
  901.         uuid(EAAAC2D7-C290-11d1-905D-00C04FD9189D),
  902.         helpstring("IDXARGBReadWritePtr Interface"),
  903.         pointer_default(unique),
  904.         local
  905.     ]
  906.     interface IDXARGBReadWritePtr : IDXARGBReadPtr
  907.     {
  908.         void PackAndMove( [in]const DXSAMPLE *pSamples, [in]ULONG cSamples );
  909.         void PackPremultAndMove( [in]const DXPMSAMPLE *pSamples, [in]ULONG cSamples );
  910.         void PackRect([in]const DXPACKEDRECTDESC *pRectDesc);
  911.         void CopyAndMoveBoth( [in]DXBASESAMPLE *pScratchBuffer, [in]IDXARGBReadPtr *pSrc,
  912.                               [in]ULONG cSamples, [in]BOOL bIsOpaque );
  913.         void CopyRect( [in] DXBASESAMPLE *pScratchBuffer, 
  914.                        [in] const RECT *pDestRect, [in]IDXARGBReadPtr *pSrc,
  915.                        [in] const POINT *pSrcOrigin, [in]BOOL bIsOpaque);
  916.         void FillAndMove( [in]DXBASESAMPLE *pScratchBuffer, [in]DXPMSAMPLE SampVal,
  917.                           [in]ULONG cSamples, [in]BOOL bDoOver );
  918.         void FillRect( [in]const RECT *pRect, [in]DXPMSAMPLE SampVal, [in]BOOL bDoOver );
  919.         void OverSample( [in]const DXOVERSAMPLEDESC * pOverDesc);
  920.         void OverArrayAndMove([in]DXBASESAMPLE *pScratchBuffer, 
  921.                               [in] const DXPMSAMPLE *pSrc,
  922.                               [in] ULONG cSamples);
  923.     };
  924.  
  925.  
  926. //+-----------------------------------------------------------------------------
  927. //
  928. //  IDXDCLock
  929. //
  930. //------------------------------------------------------------------------------
  931.  
  932.     [
  933.         object,
  934.         uuid(0F619456-CF39-11d1-905E-00C04FD9189D),
  935.         helpstring("IDXDCLock Interface"),
  936.         pointer_default(unique),
  937.         local
  938.     ]
  939.     interface IDXDCLock : IUnknown
  940.     {
  941.         HDC GetDC(void);
  942.     };
  943.  
  944.  
  945. //+-----------------------------------------------------------------------------
  946. //
  947. //  IDXTScaleOutput
  948. //
  949. //  Overview:
  950. //      Generic interface that any transform can support which allows caller to
  951. //      specify the desired output bounds.
  952. //------------------------------------------------------------------------------
  953.  
  954.     [
  955.         object,
  956.         uuid(B2024B50-EE77-11d1-9066-00C04FD9189D),
  957.         helpstring("IDXTScaleOutput Interface"),
  958.         pointer_default(unique),
  959.         local
  960.     ]
  961.     interface IDXTScaleOutput : IUnknown
  962.     {
  963.         HRESULT SetOutputSize([in] const SIZE OutSize, [in] BOOL bMaintainAspect);
  964.     };
  965.  
  966.  
  967. //+-----------------------------------------------------------------------------
  968. //
  969. //  IDXGradient
  970. //
  971. //------------------------------------------------------------------------------
  972.  
  973.     [
  974.         object,
  975.         uuid(B2024B51-EE77-11d1-9066-00C04FD9189D),
  976.         helpstring("IDXGradient Interface"),
  977.         pointer_default(unique),
  978.         local
  979.     ]
  980.     interface IDXGradient : IDXTScaleOutput
  981.     {
  982.         HRESULT SetGradient(DXSAMPLE StartColor, DXSAMPLE EndColor, BOOL bHorizontal);
  983.         HRESULT GetOutputSize([out] SIZE *pOutSize);
  984.     };
  985.  
  986.  
  987. //+-----------------------------------------------------------------------------
  988. //
  989. //  IDXTScale
  990. //
  991. //  Overview:
  992. //      This is the control interface for the simple scale transform.
  993. //
  994. //------------------------------------------------------------------------------
  995.  
  996.     [
  997.         object,
  998.         uuid(B39FD742-E139-11d1-9065-00C04FD9189D),
  999.         helpstring("IDXTScale Interface"),
  1000.         pointer_default(unique),
  1001.         local
  1002.     ]
  1003.     interface IDXTScale : IUnknown
  1004.     {
  1005.         HRESULT SetScales( [in]float Scales[2] );
  1006.         HRESULT GetScales( [out]float Scales[2] );
  1007.         HRESULT ScaleFitToSize( [in,out]DXBNDS* pClipBounds,
  1008.                                 [in]SIZE FitToSize, [in]BOOL bMaintainAspect );
  1009.     };
  1010.  
  1011.  
  1012. //+-----------------------------------------------------------------------------
  1013. //
  1014. //  IDXEffect
  1015. //  
  1016. //  Overview:
  1017. //      This interface is used to generically control transforms that are
  1018. //      transition effects.
  1019. //
  1020. //------------------------------------------------------------------------------
  1021.  
  1022.     typedef enum DISPIDDXEFFECT
  1023.     {
  1024.         DISPID_DXECAPABILITIES = 10000, // Start at 10000 to avoid conflicts with inhereted interfaces
  1025.         DISPID_DXEPROGRESS,
  1026.         DISPID_DXESTEP,
  1027.         DISPID_DXEDURATION,
  1028.         DISPID_DXE_NEXT_ID
  1029.     } DISPIDDXBOUNDEDEFFECT;
  1030.  
  1031.     typedef enum DXEFFECTTYPE
  1032.     {
  1033.         DXTET_PERIODIC = (1 << 0),  // Result at 1 is same as result at 0
  1034.         DXTET_MORPH = (1 << 1)      // Transition between 2 inputs (input 0 to input 1)
  1035.     } DXEFFECTTYPE;
  1036.  
  1037.     [
  1038.         object,
  1039.         uuid(E31FB81B-1335-11d1-8189-0000F87557DB),
  1040.         helpstring("IDXEffect Interface"),
  1041.         pointer_default(unique),
  1042.         dual
  1043.     ]
  1044.     interface IDXEffect : IDispatch
  1045.     {
  1046.         [propget, id(DISPID_DXECAPABILITIES)]
  1047.             HRESULT Capabilities([out, retval] long *pVal);
  1048.         [propget, id(DISPID_DXEPROGRESS)]
  1049.             HRESULT Progress([out, retval] float *pVal);
  1050.         [propput, id(DISPID_DXEPROGRESS)]
  1051.             HRESULT Progress([in] float newVal);
  1052.         [propget, id(DISPID_DXESTEP)]
  1053.             HRESULT StepResolution([out, retval] float *pVal);
  1054.         [propget, id(DISPID_DXEDURATION)]
  1055.             HRESULT Duration([out, retval] float *pVal);
  1056.         [propput, id(DISPID_DXEDURATION)]
  1057.             HRESULT Duration([in] float newVal);
  1058.     };
  1059.  
  1060.  
  1061. //+-----------------------------------------------------------------------------
  1062. //
  1063. //  IDXLookupTable
  1064. //
  1065. //------------------------------------------------------------------------------
  1066.  
  1067.     [
  1068.         object,
  1069.         uuid(01BAFC7F-9E63-11d1-9053-00C04FD9189D),
  1070.         helpstring("IDXLookupTable Interface"),
  1071.         pointer_default(unique),
  1072.         local
  1073.     ]
  1074.     interface IDXLookupTable : IDXBaseObject
  1075.     {
  1076.         HRESULT GetTables( [out]BYTE RedLUT[256],
  1077.                            [out]BYTE GreenLUT[256],
  1078.                            [out]BYTE BlueLUT[256],
  1079.                            [out]BYTE AlphaLUT[256] );
  1080.  
  1081.         HRESULT IsChannelIdentity([out] DXBASESAMPLE * pSampleBools);
  1082.         HRESULT GetIndexValues([in] ULONG Index, [out] DXBASESAMPLE *pSample);
  1083.         HRESULT ApplyTables([in, out] DXSAMPLE *pSamples, [in] ULONG cSamples);
  1084.     };
  1085.  
  1086.  
  1087. //+-----------------------------------------------------------------------------
  1088. //
  1089. //  IDXRawSurface
  1090. //
  1091. //  Overview:
  1092. //      User created objects support IDXRawSurface
  1093. //
  1094. //------------------------------------------------------------------------------
  1095.  
  1096.     typedef struct DXRAWSURFACEINFO
  1097.     {
  1098.         BYTE *          pFirstByte;
  1099.         long            lPitch;
  1100.         ULONG           Width;
  1101.         ULONG           Height;
  1102.         const GUID *    pPixelFormat;
  1103.         HDC             hdc;
  1104.         DWORD           dwColorKey;     // Note:  High byte must == 0xFF for color keyed surface.  Low 3 bytes are native data type.
  1105.         DXBASESAMPLE *  pPalette;
  1106.     } DXRAWSURFACEINFO;
  1107.  
  1108.     [
  1109.         object,
  1110.         uuid(09756C8A-D96A-11d1-9062-00C04FD9189D),
  1111.         helpstring("IDXRawSurface Interface"),
  1112.         pointer_default(unique),
  1113.         local
  1114.     ]
  1115.     interface IDXRawSurface : IUnknown
  1116.     {
  1117.         HRESULT GetSurfaceInfo(DXRAWSURFACEINFO * pSurfaceInfo);
  1118.     };
  1119.  
  1120.  
  1121. //+-----------------------------------------------------------------------------
  1122. //
  1123. //  IHTMLDXTransform
  1124. //
  1125. //------------------------------------------------------------------------------
  1126.  
  1127.     [
  1128.         object,
  1129.         uuid(30E2AB7D-4FDD-4159-B7EA-DC722BF4ADE5),
  1130.         helpstring("IHTMLDXTransform Interface"),
  1131.         pointer_default(unique),
  1132.         local
  1133.     ]
  1134.     interface IHTMLDXTransform : IUnknown
  1135.     {
  1136.         HRESULT SetHostUrl(BSTR bstrHostUrl);
  1137.     };
  1138.  
  1139.  
  1140. //+-----------------------------------------------------------------------------
  1141. //
  1142. //  ICSSFilterDispatch
  1143. //
  1144. //------------------------------------------------------------------------------
  1145.  
  1146.     typedef enum DXTFILTER_STATUS
  1147.     {
  1148.         DXTFILTER_STATUS_Stopped   = 0,
  1149.         DXTFILTER_STATUS_Applied,
  1150.         DXTFILTER_STATUS_Playing,
  1151.         DXTFILTER_STATUS_MAX
  1152.     } DXTFILTER_STATUS;
  1153.  
  1154.     typedef enum DXTFILTER_DISPID
  1155.     {
  1156.         DISPID_DXTFilter_Percent = 1,
  1157.         DISPID_DXTFilter_Duration,
  1158.         DISPID_DXTFilter_Enabled,
  1159.         DISPID_DXTFilter_Status,
  1160.         DISPID_DXTFilter_Apply,
  1161.         DISPID_DXTFilter_Play,
  1162.         DISPID_DXTFilter_Stop,
  1163.         DISPID_DXTFilter_MAX
  1164.     } DXTFILTER_DISPID;
  1165.  
  1166.     [
  1167.         object,
  1168.         uuid(9519152B-9484-4A6C-B6A7-4F25E92D6C6B),
  1169.         helpstring("ICSSFilterDispatch Interface"),
  1170.         pointer_default(unique),
  1171.         dual
  1172.     ]
  1173.     interface ICSSFilterDispatch : IDispatch
  1174.     {
  1175.         [propget, id(DISPID_DXTFilter_Percent)]  HRESULT Percent( [out, retval] float *pVal);
  1176.         [propput, id(DISPID_DXTFilter_Percent)]  HRESULT Percent( [in]          float newVal);
  1177.         [propget, id(DISPID_DXTFilter_Duration)] HRESULT Duration([out, retval] float *pVal);
  1178.         [propput, id(DISPID_DXTFilter_Duration)] HRESULT Duration([in]          float newVal);
  1179.         [propget, id(DISPID_DXTFilter_Enabled)]  HRESULT Enabled( [out, retval] VARIANT_BOOL *pfVal);
  1180.         [propput, id(DISPID_DXTFilter_Enabled)]  HRESULT Enabled( [in]          VARIANT_BOOL fVal);
  1181.         [propget, id(DISPID_DXTFilter_Status)]   HRESULT Status(  [out, retval] DXTFILTER_STATUS * peVal);
  1182.         [id(DISPID_DXTFilter_Apply)] HRESULT Apply();
  1183.         [id(DISPID_DXTFilter_Play)]  HRESULT Play([in, optional] VARIANT varDuration);
  1184.         [id(DISPID_DXTFilter_Stop)]  HRESULT Stop();
  1185.     };
  1186.  
  1187.  
  1188. //=== CoClass definitions =================================================
  1189.  
  1190. [
  1191.     uuid(54314D1D-35FE-11d1-81A1-0000F87557DB),
  1192.     version(1.1),
  1193.     helpstring("Microsoft DirectX Transforms Core Type Library")
  1194. ]
  1195. library DXTRANSLib
  1196. {
  1197.     importlib("stdole2.tlb");
  1198.  
  1199.     ///////////////////////////////
  1200.     // DXTransformFactory CoClass
  1201.     ///////////////////////////////
  1202.     [
  1203.         uuid(D1FE6762-FC48-11D0-883A-3C8B00C10000),
  1204.         helpstring("DXTransformFactory Class")
  1205.     ]
  1206.     coclass DXTransformFactory
  1207.     {
  1208.         [default] interface IDXTransformFactory;
  1209.         interface IDXSurfaceFactory;
  1210.     };
  1211.  
  1212.  
  1213.     ///////////////////////////////
  1214.     // DXTaskManager CoClass
  1215.     ///////////////////////////////
  1216.     [
  1217.         uuid(4CB26C03-FF93-11d0-817E-0000F87557DB),
  1218.         helpstring("DXTaskManager Class")
  1219.     ]
  1220.     coclass DXTaskManager
  1221.     {
  1222.         [default] interface IDXTaskManager;
  1223.     };
  1224.  
  1225.  
  1226.     ///////////////////////////////
  1227.     // DXTScale CoClass
  1228.     ///////////////////////////////
  1229.     [
  1230.         uuid(555278E2-05DB-11D1-883A-3C8B00C10000),
  1231.         helpstring("DXTScale Class")
  1232.     ]
  1233.     coclass DXTScale
  1234.     {
  1235.         [default] interface IDXTScale;
  1236.     };
  1237.  
  1238.  
  1239.     ///////////////////////////////
  1240.     // DXSurface CoClass
  1241.     ///////////////////////////////
  1242.     [
  1243.     uuid(0E890F83-5F79-11D1-9043-00C04FD9189D),
  1244.     helpstring("DXSurface Class")
  1245.     ]
  1246.     coclass DXSurface
  1247.     {
  1248.     [default] interface IDXSurface;
  1249.     };
  1250.  
  1251.  
  1252.     ///////////////////////////////
  1253.     // DXSurfaceModifier CoClass
  1254.     ///////////////////////////////
  1255.     [
  1256.     uuid(3E669F1D-9C23-11d1-9053-00C04FD9189D),
  1257.     helpstring("DXSurfaceModifier Class")
  1258.     ]
  1259.     coclass DXSurfaceModifier
  1260.     {
  1261.     [default] interface IDXSurfaceModifier;
  1262.     };
  1263.  
  1264.  
  1265.     ///////////////////////////////
  1266.     // DXGradient CoClass
  1267.     ///////////////////////////////
  1268.     [
  1269.     uuid(C6365470-F667-11d1-9067-00C04FD9189D),
  1270.     helpstring("DXGradient Class")
  1271.     ]
  1272.     coclass DXGradient
  1273.     {
  1274.         [default] interface IDXGradient;
  1275.     };
  1276.  
  1277.  
  1278.     ///////////////////////////////
  1279.     // DXTFilter CoClass
  1280.     ///////////////////////////////
  1281.     [
  1282.         uuid(385A91BC-1E8A-4e4a-A7A6-F4FC1E6CA1BD),
  1283.         helpstring("DXTFilter Class")
  1284.     ]
  1285.     coclass DXTFilter
  1286.     {
  1287.         [default] interface ICSSFilterDispatch;
  1288.     };
  1289. };
  1290.